package com.xayy.health.core.enums;

import lombok.Getter;

/**
 * 备份类型枚举
 *
 * @author houchengwei
 * createTime 2023/2/20
 * @version V1.0
 */
public enum BackupTypeEnum {
    //无
    NONE(0, "无"),
    //2:1备份
    TWO_ONE(1, "2:1备份"),
    //4:2备份
    FOUR_TWO(2, "4:2备份"),

    //4:3备份
    FOUR_THREE(3, "4:3备份");

    @Getter
    private Integer code;

    @Getter
    private String name;

    BackupTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }


    public static String valueof(Integer index) {
        for (BackupTypeEnum backupTypeEnum : values()) {
            if (backupTypeEnum.getCode().equals(index)) {
                return backupTypeEnum.name;
            }
        }
        return "";
    }
}
